package com.newgrand.controller;

import com.newgrand.mapper.Fg3UserMapper;
import com.newgrand.model.I8ReturnModel;
import com.newgrand.service.impl.WorkFlowService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhanglixin
 * @Data: 2023/6/5 10:51
 * @Description: TODO
 */
@Slf4j
@Api(tags = "消息自由呼接口")
@RestController
@RequestMapping("/SecondDev/api/Message")
public class MessageController {
    @Autowired
    private WorkFlowService workFlowService;

    @Autowired
    private Fg3UserMapper fg3UserMapper;

    /**
     * 消息自由呼新增
     * @param id
     * @param jsonStr
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/Add", method = RequestMethod.POST)
    public @ResponseBody
    I8ReturnModel Add(String id,@RequestBody String jsonStr) throws Exception {
        return workFlowService.MessageAdd(id,jsonStr);
    }

    /**
     * 消息自由呼查看更新
     * @param receiver
     * @param jsonStr
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/Update", method = RequestMethod.POST)
    public @ResponseBody
    I8ReturnModel Update(String receiver,@RequestBody String jsonStr) throws Exception {
        return workFlowService.MessageUpdate(receiver,jsonStr);
    }

    /**
     * 消息自由呼删除
     * @param receiver
     * @param jsonStr
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    public @ResponseBody
    I8ReturnModel Delete(String receiver,@RequestBody String jsonStr) throws Exception {
        return workFlowService.MessageDelete(receiver,jsonStr);
    }


}
